home *** CD-ROM | disk | FTP | other *** search
- // csystray.h : Header file for the CWin95SystemTray class.
- //
-
- #ifndef __CSYSTRAY_H__
- #define __CSYSTRAY_H__
-
- #include <shellapi.h>
-
- class CWin95SystemTray : public CObject
- {
- public:
- // ***** PUBLIC DATA
-
- // ***** PUBLIC FUNCTIONS
- CWin95SystemTray(HWND hWnd = 0, UINT uCallbackMsgID = 0);
- virtual ~CWin95SystemTray();
-
- // Attributes
- // Attach the callback window.
- BOOL Attach(HWND hWnd);
- HWND Detach(HWND hWnd = 0);
-
- // By default, the destructor removes the item.
- void EnableAutoUnregister(BOOL bEnable = TRUE);
-
- // Windows 95 will sent notification messages to hWnd using this message ID.
- void RegisterCallbackMessage(UINT uMsgID);
-
- // Operations
- BOOL ItemAdd(UINT uID); // Adds an item to the system tray.
- BOOL ItemDelete(UINT uID); // Removes an item from the system tray.
- BOOL ItemModify(UINT uID, // Associates an icon and or bubble text to uID.
- HICON hIcon,
- LPCSTR pszBubbleText = NULL);
- BOOL ItemSetBubbleText(UINT uID, // A shortcut of ItemModify just for text.
- LPCSTR pszBubbleText);
-
-
-
- protected:
- // ***** PROTECTED DATA
- NOTIFYICONDATA m_NotifyIconData;
- DWORD m_dwFlags;
-
- // ***** PROTECTED FUNCTIONS
- void Init(void);
- BOOL SystemTrayMessage(HWND hWnd,
- DWORD dwMessage,
- UINT uID,
- HICON hIcon = NULL,
- LPCSTR pszBubbleText = NULL);
- };
-
- #endif // __CSYSTRAY_H__
-